import { UpdateUserDto } from './user';
import { RuleType, Rule } from '@midwayjs/decorator';
import { Expose } from 'class-transformer';
import { CreateApiPropertyDoc } from '@midwayjs/swagger';

@Rule(UpdateUserDto)
export class UpdateUserRoleDto extends UpdateUserDto {
  @CreateApiPropertyDoc('校色id列表')
  @Rule(RuleType.array().optional())
  @Expose()
  roleIds: Array<number>;
}

export class CreateRole {
  @CreateApiPropertyDoc('校色名称')
  @Rule(RuleType.string().min(2).required())
  @Expose()
  name: string;
}
export class UpdateRoleDto {
  @CreateApiPropertyDoc('角色id')
  @Rule(RuleType.number().integer().required())
  @Expose()
  id: number;

  @CreateApiPropertyDoc('角色名称')
  @Rule(RuleType.string().min(2).required())
  @Expose()
  name: string;
}
